package com.swpu.project.controller;


import com.swpu.project.common.BaseResponse;
import com.swpu.project.model.entity.Radiation;
import com.swpu.project.service.IRadiationService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author swpuyanxiegroup1
 * @since 2024-07-29
 */
@RestController
@RequestMapping("/data")
public class RadiationController {

    @Resource
    IRadiationService iMineralService;




    @PreAuthorize("@verf.hasAnyAuthority('sys_query')")
    @GetMapping("/radiation/query/{id}")
    BaseResponse queryData(@PathVariable(name="id") String belongId)
    {

        return iMineralService.queryData(belongId);



    }


    @PutMapping("/radiation/update")
    @PreAuthorize("@verf.hasAnyAuthority('sys_update')")
    BaseResponse updateMineral(@RequestBody List<Radiation> minerals, @RequestParam(name = "block") String blockNum)

    {

        return iMineralService.updateMineral( minerals,blockNum);

    }








}
